# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-simanneal
_pkgorig=simanneal
pkgver=0.5.0
pkgrel=3
pkgdesc="Python module for Simulated Annealing optimization algorithm"
url="https://github.com/perrygeo/simanneal"
arch="noarch"
license="ISC"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest-xdist py3-pytest-cov"
subpackages="$pkgname-pyc"
source="https://github.com/perrygeo/simanneal/archive/$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/simanneal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
da7892ca55974a15f0751202b9d44c1834fca8f24c442644b441c0765103e778331cf71d9369f6dc756e5eba633f59e9ca0fa5ff462096d46d53b5acbcf0fe16  simanneal-0.5.0.tar.gz
"
